package com.games.game.controller;

import com.games.game.bean.UserInfo;
import com.games.game.service.User_Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class LoginInController {

    @Autowired
    private User_Service user_Service;

    @RequestMapping(value = "/loginIn", method = RequestMethod.POST)
    public UserInfo logIn(String user_name, String password) {
        UserInfo userInfo = user_Service.logIn(user_name, password);
        return userInfo;
    }

    @RequestMapping(value = "/register", method = RequestMethod.POST)
    public boolean register(String user_name, String password) {
        return user_Service.register(user_name, password);
    }



}
